#ifndef YOOHOO_XMPPCORE_STREAMERROR_H
#define YOOHOO_XMPPCORE_STREAMERROR_H

#include "xmppcore/export.h"
#include "xmppcore/abstracterror.h"
#include "xmppcore/protocolkey.h"
#include "xmppcore/xmppelement.h"

namespace yoohoo_xmppcore {

class YOOHOO_XMPPCORE_EXPORT StreamError : public AbstractError {
public:
	static const ProtocolKey PROTOCOL_KEY;
	static const ProtocolKey ERROR_DETAIL_PROTOCOL_KEY;

	StreamError(QString definedCondition = QString());
	bool shouldCloseStream();
	XmppElement::ElementType elementType() const;
	Error::ErrorType errorType() const;

protected:
	QString definedConditionNamespace();
	void writeErrorHeader(XmlWriter* writer);
	void writeErrorFooter(XmlWriter* writer);
};


}

#endif
